
<!DOCTYPE html  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
    <title>MyPetStore</title>
    <script type="text/javascript" src="/js/jquery-3.6.0.min.js"></script>
</head>
<body>
<div th:replace="/common/Header :: header"></div>
<div id="Content">
<div id="BackLink">
    <a th:href="@{ViewCategory(categoryId=${product.categoryId})}" th:text="${product.categoryId}">Return to Category</a>
</div>

<div id="Catalog">
    <h2 th:utext="${product.description}">Product DESN</h2>
<h1></h1>
    <table>
        <tr>
            <th>Item ID</th>
            <th>Product ID</th>
            <th>Description</th>
            <th>List Price</th>
            <th>&nbsp;</th>
        </tr>
            <tr th:each="item:${itemList}">
                <td>
                    <a th:href="@{ViewItem(itemId=${item.itemId})}" th:text="${item.itemId}">itemId</a>
                </td>
                <td th:text="${item.product.productId}">
                   productId
                </td>
                <td th:text="${product.name}+'  :  '+${item.attribute1}+${item.attribute2==null?'':item.attribute2}+${item.attribute3==null?'':item.attribute3}+${item.attribute4==null?'':item.attribute4}+${item.attribute5==null?'':item.attribute5}">
                    attributes and product name
                </td>
                <td th:text="${'￥'+#numbers.formatDecimal(item.listPrice,0,'COMMA',2,'POINT')}">
                    price</td>
<!--                    <fmt:formatNumber value="${item.listPrice}" pattern="$#,##0.00" />-->
                <td>
                    <a class="Button"  th:href="@{/cart/addItemToCart(workingItemId=${item.itemId})}">Add to Cart</a>
                </td>
            </tr>
        <tr>
            <td>
            </td>
        </tr>
    </table>

</div>
</div>
<div th:replace="/common/Footer :: footer"></div>
</body>
</html>